if (GetLocation():upper() ~= "DE") then
	BasicFunc = {};
	BasicFunc.Mount = {	"horse",
						"unicorn",
						"ostrich",
						"ferret",
						"wartiger",
						"berhu",
						"beast",
						"boar",
						"lion",
						"rhinoceros"
						};
						
elseif (GetLocation():upper() == "DE") then
	BasicFunc = {};
	BasicFunc.Mount = {	"schimmel",
						"rappe",
						"braunes pferd",
						"schecke",
						"schwarzes streitross",
						"wei\195\159es Streitross",
						"einhorn",
						"strau\195\159",
						"kriegstiger",
						"berhu",
						"keiler",
						"frettchen",
						"eisbestie",
						"schneebestie",
						"l\195\182we",
						"rhinozeros"
						};
end;

function MountChecker()
	local i, j = 1, 1;
	local r = false;
	local str1, str2 = " ";
	while(UnitBuff("player",i) ~= nil)do
		str1 = string.lower(UnitBuff("player",i));
		while((j <= #BasicFunc.Mount) and (r == false))do
			if(string.find((str1), BasicFunc.Mount[j]) ~= nil)then
				r = true;
				return r;
			else
				j = j + 1;
			end;
		end;
		j = 1;
--		if((string.find((str1), KC_Names["Horse"]) ~= nil) or (string.find((str1), KC_Names["Unicorn"]) ~= nil) or (string.find((str1), KC_Names["Ostrich"]) ~= nil) or (string.find((str1), KC_Names["Ferret"]) ~= nil) or (string.find((str1), KC_Names["Wartiger"]) ~= nil) or (string.find((str1), KC_Names["Berhu"]) ~= nil) or (string.find((str1), KC_Names["Dragonfang Ice Beast"]) ~= nil) or (string.find((str1), KC_Names["Boar"]) ~= nil))then
--			r = true;
--		end;
		i = i + 1;
	end;
	return r;
end;

function SearchBuff(target,buffName)
    local i = 1;
    local r = false;
    while(UnitBuff(target,i) ~= nil)do
        if(UnitBuff(target,i) == buffName)then
            r = true;
        end;
        i = i + 1;
    end;
    return r;
end;

function SearchDebuff(target,debuffName)
    local i = 1;
    local r = false;
    while(UnitDebuff(target,i) ~= nil)do
        if(UnitDebuff(target,i) == debuffName)then
            r = true;
        end;
        i = i + 1;
    end;
    return r;
end;

function CDReady(skillName)
    x = 1;
	while(x <= 5)do
        totalCount = GetNumSkill(x);
        if(totalCount)then
			y = 1;
            while(y <= totalCount) do
                if GetSkillDetail(x, y) == skillName then
                    totalCD, remainingCD = GetSkillCooldown(x, y);
					if(remainingCD <= 1)then
						return true;
					end;
                end
				y = y + 1;
            end
        end
		x = x + 1;
    end
end

function CooldownReady(num)
	local start, duration, enabled = GetActionCooldown(num);
	local r = false;
	if(duration <= 1)then
		r = true;
	end;
	return r;
end;

function ClassCheck(str, num)
	local mainClass, subClass = UnitClass("player");
	if(str == mainClass) and (num == 1)then
		return true;
	elseif(str == subClass) and (num == 2)then
		return true;
	else
		return false;
	end;
end;

function ClassError(class, num)
	if(num == 0)then
		DEFAULT_CHAT_FRAME:AddMessage("This is for "..class.." mainclass or subclass only.");
	elseif(num == 1)then
		DEFAULT_CHAT_FRAME:AddMessage("This is for "..class.." mainclass only.");
	end;
end;

function LevelError(num)
	DEFAULT_CHAT_FRAME:AddMessage("Must be at least level "..tostring(num).." to cast.");
end;

function Debug(str)
	DEFAULT_CHAT_FRAME:AddMessage(tostring(str));
end;